package com.huwaiwai.jvm.d20200619;

import sun.misc.VM;

import java.nio.ByteBuffer;

/**
 * @author 歪大哥😁
 * @date 2020-06-19.
 * -XX:MaxDirectMemorySize=5m -XX:+PrintGCDetails -Xms10m -Xmx10m
 */
public class DirectMemoryTest {

    public static void main(String[] args) {
        System.out.println(VM.maxDirectMemory()/1024/1024);
        ByteBuffer b = ByteBuffer.allocateDirect(10 * 1024 * 1024);
    }
}
